package com.boilermaker.lotterysystem.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ActivityUserStatusEnum {

    AVAILABLE(1, "未中奖"),

    UNAVAILABLE(2, "已中奖");

    private final Integer code;

    private final String message;

    /**
     * 根据名字获取枚举值
     *
     * @param name
     * @return
     */
    public static ActivityUserStatusEnum forName(String name) {

        for (ActivityUserStatusEnum e : ActivityUserStatusEnum.values()) {
            if (e.name().equalsIgnoreCase(name)) {
                return e;
            }
        }
        return null;
    }
}
